//
//  YYSourceVC.m
//  drivingSchool
//
//  Created by 子yu 刘 on 2018/8/12.
//  Copyright © 2018年 子yu 刘. All rights reserved.
//

#import "YYSourceVC.h"
#import "YYForRecordVC.h"
#import "YYSeraviceVC.h"
#import "WaterView.h"

@interface YYSourceVC ()

@end

@implementation YYSourceVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.sourceView.layer.borderColor = [UIColor whiteColor].CGColor;
    self.sourceView.layer.borderWidth = 2;
    self.lbSource.text = [UserCenterData sharedInstance].integral;
    self.navigationItem.rightBarButtonItem = [UIBarButtonItem barBtnItemWithTitle:@"兑换记录" target:self action:@selector(toRecode)];
    [self start];
}

- (void)viewDidLayoutSubviews{
    [super viewDidLayoutSubviews];
    [self start];
}
-(void)start {
    WaterView * waterView = [[WaterView alloc] initWithFrame:CGRectMake(0, 0, self.sourceView.frame.size.width, self.sourceView.frame.size.height)];
    waterView.currentWaterColor = DEF_COLOR_MAIN1;
    waterView.percentum = 0.3;
    [waterView bringSubviewToFront:self.lbSource];

    [self.sourceView addSubview:waterView];
}

- (void)toRecode{
    YYForRecordVC * recode = (YYForRecordVC *)[CFUtility getVC:@"YYForRecordVC" Storyboard:MINE];
    [self.navigationController pushViewController:recode animated:YES];
}

@end
